<?php
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者，助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
namespace app\api\validate\v1\user;

use think\Validate;

class UserAgentValidate extends Validate
{
    protected $rule = [
        'account_name' => 'require|max:64',
        'card_number' => 'require|max:128',
        'bank_name' => 'require|max:128',
        'agent_bank_card_id' => 'require',
        'date_type' => 'require|in:1,2,3',
        'time' => 'require',
        'sort_type' => 'require|in:1,2',
    ];

    protected $message = [
        'account_name.require' => '银行卡开户名必填',
        'account_name.max' => '银行卡开户名最长为64字符',
        'card_number.require' => '银行卡号必填',
        'card_number.max' => '银行卡号最长为128字符',
        'bank_name.require' => '银行卡开户行必填',
        'bank_name.max' => '银行卡开户行最长为128字符',
        'agent_bank_card_id.require' => '银行卡ID必传',
        'date_type.require' => '时间类型必传',
        'date_type.in' => '时间类型传递数值错误',
        'time.require' => '时间必传',
        'sort_type.require' => '佣金排行类型必传',
        'sort_type.in' => '佣金排行传递数值错误',
    ];

    protected $scene = [
        'bankCardAdd' => ['account_name', 'card_number', 'bank_name'],
        'bankCardDelete' => ['agent_bank_card_id'],
        'commission' => ['sort_type'],
        'analysis' => ['date_type', 'time'],
        'bankCardEdit'  =>  ['account_name', 'card_number', 'bank_name']
    ];
}